<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\admin\validate;
use think\Validate;
/**
 * Description of Huashu
 *
 * @author HuangLuSen
 */
class Employee extends Validate{
    //put your code here
    protected $rule = [
        'sid'  => 'require',
        'name' => 'require',
        'phone' => 'require|number|unique:employee'
    ];

    protected $message = [
        'state_id.require'  => '部门为必选',
        'name.require' => '用户名必填',
        'phone.require' => '电话号码必填',
        'phone.number' => '电话号码为数字',
        'phone.unique' => '电话号码已存在',
    ];
    protected $scene = [
        'edit'  =>  [
            'phone'=>'require|unique:employee,phone^id'
        ]
    ];
}
